﻿<!DOCTYPE html>
<html lang="en">
<#include "../include/resource-head.ftl"/>
<body>
<#assign active='articleList'/>
<#include "../include/common-top.ftl"/>
<div class="main-container" id="main-container">
    <div class="main-container-inner">
    <#include "../include/common-menu.ftl"/>
        <div class="main-content">
            <div class="page-content">
                <div class="row">
                    <div class="col-xs-12">
                        <div class="form-search">
                            <form role="form" class="form-inline clearfix" id="form" action="">
                                <input type="hidden" name="type" value="${type!}">
                                <div class="input-group col-xs-3">
                                    <span class="input-group-addon">标题</span>
                                    <input type="text" class="form-control" name="title" value="${title!}">
                                </div>
                            </form>
                            <div class="form-tool btn-group">
                                <button class="btn btn-sm btn-success" form="form">
                                    <i class="icon-search"></i>搜索
                                </button>
                                <a href="/admin/house/add" class="btn btn-sm btn-info">
                                    <i class="icon-plus"></i>添加
                                </a>
                            </div>
                        </div>
                        <div class="table-responsive">
                            <table id="sample-table-1" class="table table-striped table-bordered table-hover">
                                <thead>
                                <tr>
                                    <th>标题</th>
                                    <th>类型</th>
                                    <th>发布人</th>
                                    <th>地址</th>
                                    <th>联系方式</th>
                                    <th>价钱</th>
                                    <th>状态</th>
                                    <th>添加时间</th>
                                    <th>操作</th>
                                </tr>
                                </thead>
                                <tbody>
                                <#list pageInfo.list as item>
                                <tr>
                                    <td>${item.title!}</td>
                                    <td>${item.type!}</td>
                                    <td>${item.user!}</td>
                                    <td>${item.address!}</td>
                                    <td>${item.phone!}</td>
                                    <td>${item.money!}</td>
                                    <td>${item.status?switch('1','待审核','2','审核通过','3','审核不通过','4','交易完成')}</td>
                                    <td>${item.addtime?string('yyyy-MM-dd HH:mm:ss')}</td>
                                    <td>
                                        <div class="visible-md visible-lg hidden-sm hidden-xs btn-group">
                                            <a class="btn btn-xs btn-info" href="/admin/house/del/${item.id}">
                                                删除
                                            </a>
                                            <a class="btn btn-xs btn-info" href="/admin/house/detail/${item.id}">
                                                <i class="icon-edit bigger-120">详情</i>
                                            </a>

                                            <#if item.status == '4'>
                                                <a class="btn btn-xs btn-primary" href="/admin/house/info/${item.id}">
                                                    交易信息
                                                </a>
                                            </#if>

                                            <#if item.status == '1' && sessionUser.type == 'admin'>
                                                <a class="btn btn-xs btn-warning" onclick="verify('${item.id}')">
                                                    审核
                                                </a>
                                            </#if>
                                        </div>
                                    </td>
                                </tr>
                                </#list>
                                </tbody>
                            </table>
                        <#include "../include/table-page.ftl"/>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</body>
<#include "../include/resource-script.ftl"/>
<div id="verify" class="modal fade" tabindex="-1" role="dialog">
    <div class="modal-dialog" role="document">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span>
                </button>
                <h4 class="modal-title">审核发布</h4>
            </div>
            <form name="form" id="form" class="form-horizontal" method="post" action="/admin/house/verify">
                <div class="modal-body">

                    <input type="hidden" name="id" id="id">
                    <div class="form-group">
                        <label class="col-sm-2 control-label">审核意见</label>
                        <div class="col-sm-10">
                            <input type="radio" name="status" value="2" checked>通过
                            <input type="radio" name="status" value="3">不通过
                        </div>
                    </div>


                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
                    <button type="submit" class="btn btn-primary">修改</button>
                </div>
            </form>
        </div><!-- /.modal-content -->
    </div><!-- /.modal-dialog -->
</div><!-- /.modal -->

<script>
    function verify(id) {
        $("#id").val(id);
        $("#verify").modal("show");
    }

    var tip = "${tip!}";
    if (tip.length > 0) {
        alert(tip);
    }

</script>
</html>

